package com.uphone.magicleafteacher.http;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.HeaderMap;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;

/**
 * Created by hzy on 2019/1/10
 * ApiService
 *
 * @author Administrator
 */
public interface ApiService {

    // 服务器url
//    String ServiceUrl = "http://122.14.213.160:9096/moye-rest-teacher/api/";
//    String VideoUrl = "http://122.14.213.160:9000";
    String ServiceUrl = "http://49.7.118.237:8001/moye-rest-teacher/api/";
    String VideoUrl = "http://49.7.118.237:8001/moye/";


    //听力进度
    @POST("listenProcess")
    @FormUrlEncoded
    Observable<ResponseBody> listenProcess(@Field("studentId") String studentId);


    //登录
    @POST("login")
    @FormUrlEncoded
    Observable<ResponseBody> loginService(@FieldMap Map<String, Object> params);

    //听力指导审核
    //训练详情
    @POST("authAudioWork")
    @FormUrlEncoded
    Observable<ResponseBody> authAudioWork(@Field("workId") String workId, @Field("auth") String auth);

    //听力指导评分
    @Multipart
    @POST("giveAMark")
    Observable<ResponseBody> giveAMark(@PartMap Map<String, RequestBody> params,
                                       @Part MultipartBody.Part file);


    //听力指导音频作业详情
    @POST("audioWorkDetail")
    @FormUrlEncoded
    Observable<ResponseBody> workDetail(@HeaderMap Map<String, Object> headers, @FieldMap Map<String, Object> params);

    //直播参与学生
    @POST("liveClassStudents")
    @FormUrlEncoded
    Observable<ResponseBody> liveClassStudent(@HeaderMap Map<String, Object> headers, @FieldMap Map<String, Object> params);

    @POST("setStudentJifen")
    @FormUrlEncoded
    Observable<ResponseBody> setStudentJifen(@Field("jifen") String jifen);

    //获取教师信息
    @POST("teacherInfo")
    @FormUrlEncoded
    Observable<ResponseBody> infoteacher(@HeaderMap Map<String, Object> headers, @FieldMap Map<String, Object> params);

    //获取级别
    @POST("getGradeId")
    Observable<ResponseBody> getGradeId();

    //获取班级
    @POST("getClassId")
    @FormUrlEncoded
    Observable<ResponseBody> getClassId(@Field("gradeId") String gradeId);

    //复述作业驳回
    @POST("rejectRepeatWork")
    @FormUrlEncoded
    Observable<ResponseBody> rejectRepeatWork(@Field("answerId") String answerId);

    //创建直播课程
    @POST("createLiveClass")
    @FormUrlEncoded
    Observable<ResponseBody> createLiveClass(@Field("teacherId") String teacherId,
                                             @Field("liveClassName") String liveClassName,
                                             @Field("startTime") String startTime,
                                             @Field("endTime") String endTime,
                                             @Field("aheadCount") String aheadCount,
                                             @Field("gradeId") String gradeId,
                                             @Field("classId") String classId,
                                             @Field("facePic") String facePic);

    //编辑直播课程
    @POST("liveClassInfo")
    @FormUrlEncoded
    Observable<ResponseBody> liveClassInfo(@Field("liveId") String liveId);

    //编辑直播课程
    @POST("editLiveClass")
    @FormUrlEncoded
    Observable<ResponseBody> editLiveClass(@Field("teacherId") String teacherId,
                                           @Field("liveId") String liveId,
                                           @Field("classId") String classId,
                                           @Field("gradeId") String gradeId,
                                           @Field("facePic") String facePic);

    //编辑直播课程
    @POST("delLiveClass")
    @FormUrlEncoded
    Observable<ResponseBody> delLiveClass(@Field("teacherId") String teacherId,
                                          @Field("liveId") String liveId);

    @POST("homeworkDetail")
    @FormUrlEncoded
    Observable<ResponseBody> homeworkDetail(@Field("processId") String processId);

    @Multipart
    @POST("remarkHomework")
    Observable<ResponseBody> remarkHomework(@PartMap Map<String, RequestBody> params,
                                            @Part() List<MultipartBody.Part> file);

    @POST("studentFollowWork")
    @FormUrlEncoded
    Observable<ResponseBody> studentFollowWork(@Field("teacherId") String teacherId, @Field("page") String page, @Field("limit") String limit);

    @POST("finishedStudents")
    @FormUrlEncoded
    Observable<ResponseBody> finishedStudents(@Field("followId") String followId);

    @POST("audioRemarkDetail")
    @FormUrlEncoded
    Observable<ResponseBody> audioRemarkDetail(@Field("followWorkId") String followWorkId);

    @Multipart
    @POST("uploadImgFile")
    Observable<ResponseBody> uploadImgFile(@Part MultipartBody.Part file);

    @Multipart
    @POST("uploadAudioFile")
    Observable<ResponseBody> uploadAudioFile(@Part MultipartBody.Part file);

    @Multipart
    @POST("giveGuideMark")
    Observable<ResponseBody> giveGuideMark(@PartMap Map<String, RequestBody> params,
                                           @Part MultipartBody.Part file);

    @POST("bookReadList")
    @FormUrlEncoded
    Observable<ResponseBody> bookReadList(@Field("teacherId") String teacherId, @Field("page") String page, @Field("limit") String limit);

    @POST("bookReadDetail")
    @FormUrlEncoded
    Observable<ResponseBody> bookReadDetail(@Field("readId") String readId);

    @Multipart
    @POST("remarkBookRead")
    Observable<ResponseBody> remarkBookRead(@PartMap Map<String, RequestBody> params,
                                            @Part MultipartBody.Part file);

    //复述批改
    @POST("repeatDataList")
    @FormUrlEncoded
    Observable<ResponseBody> repeatDataList(@Field("teacherId") String teacherId, @Field("page") String page, @Field("limit") String limit);

    //复述批改
    @POST("repeatData")
    @FormUrlEncoded
    Observable<ResponseBody> repeatData(@Field("repeatId") String repeatId);

    //复述批改
    @POST("repeatDataDetail")
    @FormUrlEncoded
    Observable<ResponseBody> repeatDataDetail(@Field("teacherId") String teacherId, @Field("repeatId") String repeatId);

    //复述批改
    @POST("repeatWorkDetail")
    @FormUrlEncoded
    Observable<ResponseBody> repeatWorkDetail(@Field("answerId") String answerId);

    @Multipart
    @POST("remarkRepeatWork")
    Observable<ResponseBody> remarkRepeatWork(@PartMap Map<String, RequestBody> params,
                                              @Part MultipartBody.Part file);

    //指导检测
    @POST("studentAppointment")
    @FormUrlEncoded
    Observable<ResponseBody> studentAppointment(@Field("teacherId") String teacherId, @Field("page") String page, @Field("limit") String limit, @Field("studentName") String studentName);

    //指导检测详情
    @POST("appointmentDetail")
    @FormUrlEncoded
    Observable<ResponseBody> appointmentDetail(@Field("appointStuId") String appointStuId);

    @Multipart
    @POST("addTestRes")
    Observable<ResponseBody> addTestRes(@PartMap Map<String, RequestBody> params,
                                        @Part MultipartBody.Part file);

    //明星学员详情
    @POST("starStuDetail")
    @FormUrlEncoded
    Observable<ResponseBody> startDetail(@Field("starId") String starId);

    //明星学员
    @POST("starStudents")
    @FormUrlEncoded
    Observable<ResponseBody> startList(@FieldMap Map<String, Object> params);

    //其他课程
    @POST("otherLiveClass")
    @FormUrlEncoded
    Observable<ResponseBody> otherLiveClass(@Field("teacherId") String teacherId, @Field("page") String page, @Field("limit") String limit);

    //上传头像
    @POST("modTeacherImg")
    @FormUrlEncoded
    Observable<ResponseBody> modTeacherImg(@Field("teacherId") String teacherId, @Field("teacherImg") String teacherImg);

    //其他课程
    @POST("otherClassDetail")
    @FormUrlEncoded
    Observable<ResponseBody> otherClassDetail(@Field("liveId") String liveId);


    //教师消息
    @POST("teacherMsg")
    @FormUrlEncoded
    Observable<ResponseBody> teacherMsg(@Field("teacherId") String teacherId, @Field("page") String page, @Field("limit") String limit);

    //修改密码
    @POST("modifyPassword")
    @FormUrlEncoded
    Observable<ResponseBody> change(@FieldMap Map<String, Object> params);

    //意见反馈
    @POST("giveSuggestion")
    @FormUrlEncoded
    Observable<ResponseBody> opinion(@FieldMap Map<String, Object> params);

    //关于魔叶
    @POST("aboutMoye")
    Observable<ResponseBody> aboutMoye();

    //听力指导
    @POST("studentAudioGuide")
    @FormUrlEncoded
    Observable<ResponseBody> studentAudioGuide(@Field("teacherId") String teacherId, @Field("page") String page, @Field("limit") String limit);

    //直播课程作业
    @POST("liveClassWork")
    @FormUrlEncoded
    Observable<ResponseBody> liveClassWork(@Field("liveId") String liveId, @Field("page") String page, @Field("limit") String limit);

    //直播课程
    @POST("teacherLiveList")
    @FormUrlEncoded
    Observable<ResponseBody> teacherLive(@Field("teacherId") String teacherId, @Field("page") String page, @Field("limit") String limit);

    //作业批改
    @POST("homeworks")
    @FormUrlEncoded
    Observable<ResponseBody> homeWorks(@Field("teacherId") String teacherId, @Field("page") String page, @Field("limit") String limit);

    //听力指导音频作业的学生   三种状态
    @POST("audioSubmitList")
    @FormUrlEncoded
    Observable<ResponseBody> submitList(@Field("workBookId") String workBookId, @Field("page") String page, @Field("limit") String limit);

}
